#ifndef MYTABLEWIDGET_H
#define MYTABLEWIDGET_H


#include <QFont>
#include <QWidget>
#include <QTableWidget>

class MyTableWidget : public QTableWidget
{
    Q_OBJECT
public:
    explicit MyTableWidget(QWidget *parent = nullptr);

    void createHorizontalHeader(QStringList colLabels);
    void createVerticalHeader(QStringList rowLabels);
    QTableWidgetItem * createItem(QString text,  int row, int col);
    void highLighterRow(QString styleSheet, int row);
    void CancelHighLighterRow(QString styleSheet);

    /*样式设计*/
    void setItemStyle(QBrush color, QFont itemFont,  int row, int col);
    void setHorizontalHeaderStyle(QFont headerFont, QString styleSheet, bool headFixed);
    void setVerticalHeaderStyle(QFont headerFont, QString styleSheet, bool headFixed);
    void setTableWidgetStyle(void);

    // 根据pos获取item的row和col
    // 返回值为0为正常，为-1为异常
    QTableWidgetItem * getItemRowAndColFromPos(QPoint pos, int & row, int & col);

signals:

};

#endif // MYTABLEWIDGET_H
